#include <reg52.h>
typedef unsigned uint8;
typedef unsigned uint16;
sbit ENLED=P1^4;
sbit ADDR0=P1^0;
sbit ADDR1=P1^1;
sbit ADDR2=P1^2;
sbit ADDR3=P1^3;
main()
{
	uint16 i;
	uint8 j;
	//控制工作部件
	ENLED=0;ADDR3=1;
	ADDR0=0;ADDR1=1;ADDR2=1;
	//
	while(1)
	{
		P0=~(1<<j++);  //00000001 取反后 11111110
		for(i=0;i<20000;i++);
		if(8==j)
		{
			j=0;
		}
	}
}